<!--
 * @Author: lirl
 * @Date: 2023-04-05 19:08:07
 * @Description: 在办工作
-->
<template>
  <biz-outer-task-list
    page-title="在办工作"
    :template-id="$route.query.templateId"
    :get-function="getFunction"
    :columns="columns"
    show-index
    @openTaskForm="openTaskForm"
  ></biz-outer-task-list>
</template>

<script>
import { WorkService } from 'jdf-jssdk';
import { renderLink, timeConvert } from 'jdf-util';
import { bizServiceURL } from '@/api/utils/constants';
import routerJump from '@/api/utils/router-jump';

export default {
  data() {
    return {
      openTaskForm: routerJump.openTaskForm,
      columns: [
        {
          prop: 'applyTitle',
          label: '标题',
          attrs: {
            'show-overflow-tooltip': true,
            minWidth: 200,
          },
          render: (h, params) => renderLink(h, params.row.applyTitle, () => {})
        },
        {
          prop: 'updateTime',
          label: '处理时间',
          width: 180,
          attrs: {
            align: 'center',
            formatter: (row) => timeConvert(row.updateTime, 'YYYY-MM-DD'),
          }
        },
        {
          prop: 'templateName',
          width: 180,
          label: '文种',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'processHotExtend2',
          width: 180,
          label: '文件编号',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'nodeName',
          width: 180,
          label: '办理环节',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'applicant.userName',
          width: 180,
          label: '起草人',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'createTime',
          label: '创建时间',
          width: 180,
          attrs: {
            align: 'center',
            formatter: (row) => timeConvert(row.createTime, 'YYYY-MM-DD'),
          }
        }
      ]
    };
  },
  methods: {
    getFunction(params) {
      return new WorkService(bizServiceURL).getRunningTaskWithProcess(params);
    }
  }
};
</script>
